package com.ai.cmdc.codeutil.export_generator.dao;

import com.ai.cmdc.codeutil.bean.ExportColumn;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zhoulk
 * @Description:
 * @date: 2019/7/25
 */
@Mapper
public interface QryTableMapper {

    @Select("   select TABLE_NAME tableName, COLUMN_NAME columnName, DATA_LENGTH dataLength, DATA_TYPE dataType, DATA_PRECISION dataPrecision  \n" +
            "     from user_tab_columns\n" +
            "    where TABLE_NAME=#{table}")
    List<ExportColumn> qryColumn(@Param("table") String table);

    @Select("select TABLE_NAME tableName, Column_NAME columnName, COMMENTS comments\n" +
            "from user_col_comments \n" +
            "where TABLE_NAME = #{table}")
    List<ExportColumn> qryColumnComment(@Param("table") String table);
}
